﻿@ModelType List(Of SistemaINCA.GET_MENUBAR_BY_ROL_DATATYPE)
@code
    Dim count_submenu As Integer = 0
    
End Code

<ul id="menu">
@For Each MenuP In From menuRaiz In Model
                   Where menuRaiz.ID_PARENT = 0
                   Select menuRaiz

    @<li>
        @code
            count_submenu = (From SubMenu In Model Where (SubMenu.ID_PARENT = MenuP.ID_MENU) Select SubMenu).Count
        End Code

        @If Not count_submenu = 0 Then
            @<a href="#">@MenuP.NOMBRE_MENU</a>
            @<ul id="subnav">
                @For Each MenuSec In From SubMenu In Model
                                     Where (SubMenu.ID_PARENT = MenuP.ID_MENU)
                                     Select SubMenu
                    @<li title="@MenuSec.DESCRIPCION" >@Html.ActionLink(MenuSec.NOMBRE_MENU, MenuSec.URL_ACTION_NAME, MenuSec.URL_CONTROLLER)</li>
                Next                 
            </ul>                    
        Else
            @Html.ActionLink(MenuP.NOMBRE_MENU, MenuP.URL_ACTION_NAME, MenuP.URL_CONTROLLER)
        End If
    </li>

Next           
</ul>
